#include <iostream>
#include <vector>
#include "expr.hh"
using namespace std;

int main(int argc, char *argv[]) {
	string in;
	while (getline(cin, in)) {
		// skip the leading space
		int i = 0;
		while (i < in.size() && isspace(in[i])) ++i;
		if ( i == in.size() ) continue;
		else in = in.substr(i, in.size());
		expr e(in);
		int result = e.calc();
		if (e.isValid()) {
			cout<<"expression contains eror: "<<endl<<in<<endl;
		} else {
			cout<<in<<" = "<<result<<endl;
		}
	}
}
